<?php
namespace app\composite;

abstract class CompanyBase
{
    protected $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }

    /**
     * 增加节点
     * @param CompanyBase $company
     * @return mixed
     */
    abstract function add(CompanyBase $company);

    /**
     * 删除节点
     * @param CompanyBase $company
     * @return mixed
     */
    abstract function remove(CompanyBase $company);

    /**
     * 输出节点信息
     * @param $deep
     * @return mixed
     */
    abstract function show($deep);

    /**
     * 节点职责
     * @param $deep
     * @return mixed
     */
    abstract function work($deep);
}